/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hcbank.jpa.entities.helper;

import com.hcbank.classes.Account;
import com.hcbank.jpa.entities.AccountEntity;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author NHAHV
 */
public class AccountHelper {

    public AccountHelper() {
    }

    public Account toAccount(AccountEntity ae) {
        Account a = new Account();
        try {
            a.setId(ae.getId());
            a.setNumber(ae.getNumber());
            a.setPin(ae.getPin());
           
            if (ae.getCustomerId() != null) {
                a.setCustomerId(ae.getCustomerId().getId());
            }
             a.setStatus(ae.getStatus());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {

            return a;
        }




    }


}
